package edu.bu.cs673.superkids123.children.model;


import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import edu.bu.cs673.superkids123.common.model.User;
@Entity
@Table(name="CompletedLessons")
public class CompletedLesson {
	
	/**
	 * @author Abdelghani Bhalla
	 */
	public CompletedLesson(Date startDate, Date endDate, boolean isCompleted) {
		super();
		this.startDate = startDate;
		this.endDate = endDate;
		this.isCompleted = isCompleted;
	}

	@Id @GeneratedValue
	@Column(name="CompletedLessonID")
	private int id;
	
	@Column(name="StartDate")
	private Date startDate;
	
	@Column(name="EndDate")
	private Date endDate;
	
	@Column(name="IsCompleted")
	private boolean isCompleted;
	
	@ManyToOne
	@JoinColumn(name="LessonID")
	@NotFound(action=NotFoundAction.IGNORE)
	private Lesson lesson;
	
	@ManyToOne
	@JoinColumn(name="UserID")
	@NotFound(action=NotFoundAction.IGNORE)
	private User child;
	
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public boolean isCompleted() {
		return isCompleted;
	}

	public void setCompleted(boolean isCompleted) {
		this.isCompleted = isCompleted;
	}

	public Lesson getLesson() {
		return lesson;
	}

	public void setLesson(Lesson lesson) {
		this.lesson = lesson;
	}

	public User getChild() {
		return child;
	}

	public void setChild(User child) {
		this.child = child;
	}

	public CompletedLesson(){
		
	}
	

}
